#pragma once
#include"Common.h"
#include"ThreadCache.h"


static void* ConcurrentAlloc(size_t size)
{
	assert(size);

	if (pTLSThreadCache == nullptr)
	{
		pTLSThreadCache = new ThreadCache;
	}

	return pTLSThreadCache->Allocate(size);
}


static void ConcurrentFree(void* ptr)
{
	assert(ptr);
	size_t size=PageCache::GetInstence()->MapObjectToSpan(ptr)->_objSize;

	pTLSThreadCache->Deallocate(ptr, size);
}